﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using VeMayBayDTO;
namespace VeMayBayDAO
{
    public  class DatVeDAO
    {
        public static bool GhiNhanDatVe(DatVeDTO datve)
        {
            string query = @"insert into datve (machuyenbay,cmnd,soluong,mahangve,tongTien,ngaydat) 
                             values (" + datve.Ve.ChuyenBay.MaChuyenBay + ",'" + datve.Ve.KhachHang.CMND + "'," + datve.Ve.SoLuong + "," + datve.Ve.HangVe.MaHangVe + "," + datve.Ve.TongTien + ",'" + datve.NgayDat.ToShortDateString() + "')";
            int n = DataProvider.ExecNonQuery(query);
            if (n == 0)
                return false;
            return true;
        }
    }
}
